@echo off
cd %~dp0%..

echo Setting up environment...
echo Current Version: %VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_PATCH%.%VERSION_TWEAK%
set QT_BASEDIR=C:\Qt
set QT_KIT=msvc2019_64
set QT_VERSION=6.5.0
if not exist "%QT_BASEDIR%\%QT_VERSION%" (
    set QT_VERSION=5.15.2
    set QT_PATH=%QT_BASEDIR%\%QT_VERSION%\%QT_KIT%
    set Qt5_DIR=%QT_PATH%\lib\cmake\Qt5
) else (
    set QT_PATH=%QT_BASEDIR%\%QT_VERSION%\%QT_KIT%
    set Qt6_DIR=%QT_PATH%\lib\cmake\Qt6
)
echo Detect QT_PATH: %QT_PATH%
set PATH=%QT_PATH%\bin;%PATH%

set VS_BASEDIR=C:\Program Files (x86)\Microsoft Visual Studio
set VS_VERSION=2022
set VS_BASEDIR=%VS_BASEDIR%\%VS_VERSION%
set VS_TYPE=Enterprise
if not exist "%VS_BASEDIR%\%VS_TYPE%" (
    set VS_TYPE=Community
)
set VS_BASEDIR=%VS_BASEDIR%\%VS_TYPE%
echo Detect VS_BASEDIR: %VS_BASEDIR%
set VCINSTALLDIR=%VS_BASEDIR%\VC
@REM call "%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" x64

@REM set VERSION_NAME=%VERSION_MAJOR%_%VERSION_MINOR%_%VERSION_PATCH%_%VERSION_TWEAK%
set VERSION_NAME=latest
set CHANEL_NAME=gh
set DEPLOY_NAME=DBLParse_%VERSION_NAME%_%CHANEL_NAME%
